Optimal. Leaf size=88 \[ -\frac {(c+d x)^2}{f}+\frac {(c+d x)^3}{3 d}+\frac {2 d (c+d x) \log \left (1+e^{2 (e+f x)}\right )}{f^2}+\frac {d^2 \text {PolyLog}\left (2,-e^{2 (e+f x)}\right )}{f^3}-\frac {(c+d x)^2 \tanh (e+f x)}{f} \]
[Out]
________________________________________________________________________________________
Rubi [A]
time = 0.10, antiderivative size = 88, normalized size of antiderivative = 1.00, number of steps
used = 6, number of rules used = 6, integrand size = 16, \(\frac {\text {number of rules}}{\text {integrand size}}\) = 0.375, Rules used = {3801, 3799,
2221, 2317, 2438, 32} \begin {gather*} \frac {2 d (c+d x) \log \left (e^{2 (e+f x)}+1\right )}{f^2}-\frac {(c+d x)^2 \tanh (e+f x)}{f}-\frac {(c+d x)^2}{f}+\frac {(c+d x)^3}{3 d}+\frac {d^2 \text {Li}_2\left (-e^{2 (e+f x)}\right )}{f^3} \end {gather*}
Antiderivative was successfully verified.
[In]
[Out]
Rule 32
Rule 2221
Rule 2317
Rule 2438
Rule 3799
Rule 3801
Rubi steps
\begin {align*} \int (c+d x)^2 \tanh ^2(e+f x) \, dx &=-\frac {(c+d x)^2 \tanh (e+f x)}{f}+\frac {(2 d) \int (c+d x) \tanh (e+f x) \, dx}{f}+\int (c+d x)^2 \, dx\\ &=-\frac {(c+d x)^2}{f}+\frac {(c+d x)^3}{3 d}-\frac {(c+d x)^2 \tanh (e+f x)}{f}+\frac {(4 d) \int \frac {e^{2 (e+f x)} (c+d x)}{1+e^{2 (e+f x)}} \, dx}{f}\\ &=-\frac {(c+d x)^2}{f}+\frac {(c+d x)^3}{3 d}+\frac {2 d (c+d x) \log \left (1+e^{2 (e+f x)}\right )}{f^2}-\frac {(c+d x)^2 \tanh (e+f x)}{f}-\frac {\left (2 d^2\right ) \int \log \left (1+e^{2 (e+f x)}\right ) \, dx}{f^2}\\ &=-\frac {(c+d x)^2}{f}+\frac {(c+d x)^3}{3 d}+\frac {2 d (c+d x) \log \left (1+e^{2 (e+f x)}\right )}{f^2}-\frac {(c+d x)^2 \tanh (e+f x)}{f}-\frac {d^2 \text {Subst}\left (\int \frac {\log (1+x)}{x} \, dx,x,e^{2 (e+f x)}\right )}{f^3}\\ &=-\frac {(c+d x)^2}{f}+\frac {(c+d x)^3}{3 d}+\frac {2 d (c+d x) \log \left (1+e^{2 (e+f x)}\right )}{f^2}+\frac {d^2 \text {Li}_2\left (-e^{2 (e+f x)}\right )}{f^3}-\frac {(c+d x)^2 \tanh (e+f x)}{f}\\ \end {align*}
________________________________________________________________________________________
Mathematica [C] Result contains complex when optimal does not.
time = 6.15, size = 205, normalized size = 2.33 \begin {gather*} c^2 x+c d x^2+\frac {d^2 x^3}{3}-\frac {(c+d x)^2 \text {sech}(e) \text {sech}(e+f x) \sinh (f x)}{f}+\frac {2 c d (\log (\cosh (e+f x))-f x \tanh (e))}{f^2}+\frac {d^2 \left (-i \pi \log \left (1+e^{2 f x}\right )+2 f x \log \left (1-e^{-2 \left (f x+\tanh ^{-1}(\coth (e))\right )}\right )+i \pi (f x+\log (\cosh (f x)))+2 \tanh ^{-1}(\coth (e)) \left (f x+\log \left (1-e^{-2 \left (f x+\tanh ^{-1}(\coth (e))\right )}\right )-\log \left (i \sinh \left (f x+\tanh ^{-1}(\coth (e))\right )\right )\right )-\text {PolyLog}\left (2,e^{-2 \left (f x+\tanh ^{-1}(\coth (e))\right )}\right )-e^{-\tanh ^{-1}(\coth (e))} f^2 x^2 \sqrt {-\text {csch}^2(e)} \tanh (e)\right )}{f^3} \end {gather*}
Antiderivative was successfully verified.
[In]
[Out]
________________________________________________________________________________________
Maple [B] Leaf count of result is larger than twice the leaf count of optimal. \(184\) vs.
\(2(86)=172\).
time = 1.29, size = 185, normalized size = 2.10
method | result | size |
risch | \(\frac {d^{2} x^{3}}{3}+d c \,x^{2}+c^{2} x +\frac {c^{3}}{3 d}+\frac {2 d^{2} x^{2}+4 c d x +2 c^{2}}{f \left (1+{\mathrm e}^{2 f x +2 e}\right )}+\frac {2 d c \ln \left (1+{\mathrm e}^{2 f x +2 e}\right )}{f^{2}}-\frac {4 d c \ln \left ({\mathrm e}^{f x +e}\right )}{f^{2}}-\frac {2 d^{2} x^{2}}{f}-\frac {4 d^{2} e x}{f^{2}}-\frac {2 d^{2} e^{2}}{f^{3}}+\frac {2 d^{2} \ln \left (1+{\mathrm e}^{2 f x +2 e}\right ) x}{f^{2}}+\frac {d^{2} \polylog \left (2, -{\mathrm e}^{2 f x +2 e}\right )}{f^{3}}+\frac {4 d^{2} e \ln \left ({\mathrm e}^{f x +e}\right )}{f^{3}}\) | \(185\) |
Verification of antiderivative is not currently implemented for this CAS.
[In]
[Out]
________________________________________________________________________________________
Maxima [F]
time = 0.00, size = 0, normalized size = 0.00 \begin {gather*} \text {Failed to integrate} \end {gather*}
Verification of antiderivative is not currently implemented for this CAS.
[In]
[Out]
________________________________________________________________________________________
Fricas [C] Result contains complex when optimal does not.
time = 0.58, size = 1200, normalized size = 13.64 \begin {gather*} \text {Too large to display} \end {gather*}
Verification of antiderivative is not currently implemented for this CAS.
[In]
[Out]
________________________________________________________________________________________
Sympy [F]
time = 0.00, size = 0, normalized size = 0.00 \begin {gather*} \int \left (c + d x\right )^{2} \tanh ^{2}{\left (e + f x \right )}\, dx \end {gather*}
Verification of antiderivative is not currently implemented for this CAS.
[In]
[Out]
________________________________________________________________________________________
Giac [F]
time = 0.00, size = 0, normalized size = 0.00 \begin {gather*} \text {could not integrate} \end {gather*}
Verification of antiderivative is not currently implemented for this CAS.
[In]
[Out]
________________________________________________________________________________________
Mupad [F]
time = 0.00, size = -1, normalized size = -0.01 \begin {gather*} \int {\mathrm {tanh}\left (e+f\,x\right )}^2\,{\left (c+d\,x\right )}^2 \,d x \end {gather*}
Verification of antiderivative is not currently implemented for this CAS.
[In]
[Out]
________________________________________________________________________________________